package com.mobiporter.adias.tags.utils;

public class LinkGenerator 
{
	public LinkGenerator(String url)
	{
		this.url = url ;
		if (url.contains("?"))
			paramsPrexist = true ;
	}
	
	private String url ;
	private boolean paramsPrexist = false ;
	
	public boolean isParamsPrexist() {
		return paramsPrexist;
	}

	public void setParamsPrexist(boolean paramsPrexist) {
		this.paramsPrexist = paramsPrexist;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public void addRequestParam(String name,String value)
	{
		if (paramsPrexist)
		{
			url += "&"+name+"="+value ;
		}
		else
		{
			url += "?"+name+"="+value ;
			paramsPrexist = true ;
		}
	}
	
	
}